package com.gupao.p7store.common.thread.pool;

import com.gupao.p7store.common.thread.factory.SimpleThreadFactory;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * desc:
 *
 * @ClassName: com.gupao.p7store.common.thread.pool.GupaoThreadPool
 * @author: dengbicheng
 * @date: 2022-02-16 14:09
 * @version: v 1.0.0
 */
public class GupaoThreadPool {

    private static final int MAX_THREAD_NUMBER = Runtime.getRuntime().availableProcessors() * 10;

    public static ExecutorService APOLLO_DB_RESTORE = new ThreadPoolExecutor(2, MAX_THREAD_NUMBER
        , 3L,TimeUnit.MINUTES, new ArrayBlockingQueue<>(1000), new SimpleThreadFactory());

    public static ExecutorService APOLLO_DB_DUMP = new ThreadPoolExecutor(2, MAX_THREAD_NUMBER
        , 5L,TimeUnit.MINUTES, new ArrayBlockingQueue<>(1000), new SimpleThreadFactory());
}
